﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Whale : Enemy
{
    public float scale = 1.5f;
    protected List<Transform> bombList = new List<Transform>();

    public void Swallow() //animation Event
    {
        if (targetPoint.CompareTag("Bomb"))
        {
            if(bombList.Count == 2){
                foreach (var item in bombList)
                {
                    item.gameObject.SetActive(true);
                    item.GetComponent<Bomb>()?.TrunOn();
                }
                GetHit(10);
                return;
            }
            targetPoint.gameObject.SetActive(false);
            targetPoint.GetComponent<Bomb>()?.TrunOff();
            transform.localScale *= scale;
            bombList.Add(targetPoint);
        }
    }
}
